package sample.plugin.language.python;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import io.github.rosemoe.sora.lang.EmptyLanguage;
import io.github.rosemoe.sora.lang.Language;
import io.github.rosemoe.sora.lang.analysis.AnalyzeManager;
import io.github.rosemoe.sora.lang.format.Formatter;
import io.github.rosemoe.sora.lang.smartEnter.NewlineHandler;
import io.github.rosemoe.sora.text.ContentReference;
import io.github.rosemoe.sora.widget.SymbolPairMatch;

public final class PythonLanguage extends Language {
    public final static String ID = "python";
    private final PythonHighlightAnalyzer analyzer;

    public PythonLanguage() {
        this.analyzer = new PythonHighlightAnalyzer();
    }

    @NonNull
    @Override
    public AnalyzeManager getAnalyzeManager() {
        return analyzer;
    }

    @Override
    public int getInterruptionLevel() {
        return INTERRUPTION_LEVEL_STRONG;
    }

    @Override
    public int getIndentAdvance(@NonNull ContentReference contentReference, int i, int i1) {
        return 0;
    }

    @Override
    public boolean useTab() {
        return false;
    }

    @Override
    public Formatter getFormatter() {
        return new EmptyLanguage.EmptyFormatter();
    }

    @Override
    public SymbolPairMatch getSymbolPairs() {
        return new SymbolPairMatch.DefaultSymbolPairs();
    }

    @Nullable
    @Override
    public NewlineHandler[] getNewlineHandlers() {
        return new NewlineHandler[0];
    }

    @Override
    public String getId() {
        return ID;
    }
}
